using UnityEngine;
using UnityEngine.EventSystems;

/// <summary>
/// <para>教学框架所使用的辅助类，在需要监控某个UI元素是否被点击时将其挂载至该UI元素，若设置相应的教学节点，则在点击时会触发该教学节点的事件</para>
/// </summary>
public class TutorialClick : MonoBehaviour, IPointerClickHandler
{
	TutorialEventNode _event = null;

	/// <summary>
	/// <para>关联的教学事件节点</para>
	/// </summary>
	public TutorialEventNode Node {
		get { return _event; }
		set { _event = value; }
	}

	public void OnPointerClick(PointerEventData eventData)
	{
		if (Node != null) {
			Node.Shoot();
		}
	}
}